<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>文件上传示例</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="container">
    <h1>文件上传示例</h1>
    
    <div class="upload-section">
      <h2>单文件上传</h2>
      <form id="singleUploadForm" enctype="multipart/form-data">
        <div class="form-group">
          <input type="file" id="singleFile" name="file" required>
        </div>
        <button type="submit" class="btn">上传文件</button>
      </form>
      <div id="singleFileResult" class="result"></div>
    </div>
    
    <div class="upload-section">
      <h2>多文件上传</h2>
      <form id="multipleUploadForm" enctype="multipart/form-data">
        <div class="form-group">
          <input type="file" id="multipleFiles" name="files" multiple required>
          <small>最多可选择5个文件</small>
        </div>
        <button type="submit" class="btn">上传文件</button>
      </form>
      <div id="multipleFileResult" class="result"></div>
    </div>
    
    <div class="files-section">
      <h2>已上传文件列表</h2>
      <button id="refreshFiles" class="btn">刷新列表</button>
      <ul id="filesList"></ul>
    </div>
  </div>

  <script src="script.js"></script>
</body>
</html> 